/**
 *
 */
package com.magist.manage.enums;


import com.magist.core.enums.BaseEnum; import com.magist.core.util.TxtUtil;

/**
 * 到期状态
 */
public enum ExpireStatusEnum implements BaseEnum {

    NOW("0","已到期"),IN_1M("1","1个月内到期"),IN_3M("3","3个月内到期"),IN_6M("6","6个月内到期");

    private String code;

    private String desc;

    private ExpireStatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ExpireStatusEnum getByCode(String code) {
        if (TxtUtil.isEmpty(code))
            return null;
        ExpireStatusEnum[] allEnums = ExpireStatusEnum.values();
        for (ExpireStatusEnum thisEnum : allEnums) {
            if (thisEnum.code.equals(code)) {
                return thisEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
